import { useContext, useState } from "react";
import ComponentB from "./ComponentB";
import TestContext from "./Context";
import styled from "styled-components";
const ComponentA = () => {
  const context = useContext(TestContext);
  const [conetxtValue, setContextValue] = useState("change3");
  const Header = styled.div`
    width: 100%;
    height: 1rem;
    background: red;
  `;
  return (
    <div>
      <Header />
      {/* <TestContext.Provider>
        我是A组件{context}
        <button onClick={() => setContextValue("change4")}>点我改值</button>
        <TestContext.Provider>
          <ComponentB />
        </TestContext.Provider>
      </TestContext.Provider> */}
    </div>
  );
};
export default ComponentA;
